package cn.wolfcode.mapper;

import cn.wolfcode.domain.Notice;
import cn.wolfcode.qo.QueryObject;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface NoticeMapper {
    int deleteByPrimaryKey(Long id);

    Long insert(Notice record);

    Notice selectByPrimaryKey(Long id);

    List<Notice> selectAll();

    int updateByPrimaryKey(Notice record);

    List<Notice> selectForList(@Param("empId") Long empId, @Param("qo") QueryObject qo, @Param("admin") boolean admin);


    void updateStatus(@Param("id") Long id, @Param("b") boolean b);

    void insertReadStatus(@Param("id") Long id, @Param("empId") Long empId, @Param("b") boolean b);


    boolean selectReadStatus(@Param("nid") Long nid, @Param("empId") Long empId);

    void updateReadStatus(@Param("nid") Long nid, @Param("empId") Long empId, @Param("b") boolean b);


    List<Notice> queryUnreadNotices(Long id);

    int queryUnreadSize(Long empId);

}